import { defineStore } from "pinia";
import { useNumStore } from "./num";



export const useDemoStore = defineStore('demo',{
  // state   data
  // getters   computed
  // actions   methods
  state(){
    return {
       obj:{
        name:'zs',
        age:18
       }
    }
  },
  getters:{
    getName(){
      return this.obj.name
    }
  },
  actions:{
    demoAction(params,name){
      const numStore = useNumStore()
      const numVal = numStore.numAdd()
      if(this.obj.age>numVal){
        console.log("age 大于 num");
      }else{
        console.log("age 不大于 num");
      }
      console.log(a);
      return params
    }


  }
})
